<%-- 
    Document   : trangchu
    Created on : Dec 1, 2011, 10:50:47 AM
    Author     : BlueZky
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<div class="content">
    <!-- Product section-->
    <div class="partion">				
        <div class="box">
            <c:forEach items="${danhSach}" var="item" varStatus="status" begin="0" end="3" step="1">   
                <div class="product-box" >
                    <div class ="new"></div>
                    <a href="chitiet.htm?PID=${item.masp}">
                        <div class="balance">
                            <img src="${item.hinhanh}" alt="${item.tensp}"/>
                        </div>
                        <div class="des">
                            <strong><c:if test="${fn:length(item.tensp) gt 20}">
                             ${fn:substring(item.tensp,0, 20)}...
                             </c:if>
                             <c:if test="${fn:length(item.tensp) lt 20}">
                                 ${item.tensp}
                             </c:if></strong>
                            <br/>
                            <span class="price">From $${item.gia}</span>
                        </div>
                    </a>
                </div> 
            </c:forEach>

        </div>
        <div class="horizontal-line"></div>
        <div class="box">
            <c:forEach items="${danhSach}" var="item" varStatus="status" begin="4" end="7" step="1">
                <div class="product-box" >
                    <div class ="new"></div>
                    <a href="chitiet.htm?PID=${item.masp}">
                        <div class="balance">
                            <img src="${item.hinhanh}"  alt="${item.tensp}"/>
                        </div>
                        <div class="des">
                            <strong>${item.tensp}</strong>
                            <br/>
                            <span class="price">From $${item.gia}</span>
                        </div>
                    </a>
                </div> 
            </c:forEach>
        </div>
        <div class="horizontal-line"></div>
        <div class="box"> 
            <div class="more">
                <a href="#">
                    <img src="product/apple-store-app.jpg" width="32" height="37"/>
                    <div class="mcontent">
                        <strong>Download the Appstore Apps.</strong>
                        <br/> 
                        <span class="price">It's the easiest way to get an iPhone 4S - right from your current iPhone.</span>
                    </div>
                </a>                                
            </div>
        </div>
        <div class="horizontal-line" style="border:none"></div>
    </div>
    <!-- End product section-->

    <!--product menu bar-->
    <div class="content-menu">
        <div class="mid-left">
            <div class="citem">Sản phẩm</div>
            <div class="cexpand"></div>
            <div class="citem">Bán chạy</div>
        </div>
        <div class="mid-right">
            <form id="top-num" method="post" action="timkiem.htm?a=${a}&search=${search}${cUrl}&page=0">
                <div class="mselect" >
                    <select id="number" name="num" >
                        <option <c:if test="${num eq 8}">selected</c:if> value="8">8</option>
                        <option <c:if test="${num eq 16}">selected</c:if> value="16">16</option>
                        <option <c:if test="${num eq 32}">selected</c:if> value="32">32</option>
                    </select>
                </div>
                <div class="mselect" >
                    <select id="dispay" name="display" >
                        <option value="0">Grid</option>
                        <option value="1">Table</option>
                    </select></div>
            </form>
        </div>
    </div>

    <!-- End product menu bar-->

    <!--Product section-->
    <div class="partion">				
        <div class="box">

            <c:forEach items="${banChay}" var="item" varStatus="status">
                <div class="best-sell" <c:if test="${status.index eq 4}">style="border:none"</c:if>>
                    <a href="chitiet.htm?PID=${item.masp}">
                        <div class="btitle">
                            <c:if test="${fn:length(item.tensp) gt 25}">
                             ${fn:substring(item.tensp,0, 25)}...
                             </c:if>
                             <c:if test="${fn:length(item.tensp) lt 25}">
                                 ${item.tensp}
                             </c:if>
                        </div>
                        <div class="balance" style="min-height: 160px ">
                            <img src="${item.hinhanh}" />
                        </div>
                    </a>
                    <div style="margin: auto; padding: 0 10px;">
                        <div class="price">$${item.gia}</div>
                        <a href="giohang.htm?a=a&pid=${item.masp}&soLuong=1" ><div class="btn-buy">Mua</div></a>
                    </div>                                
                </div>
            </c:forEach>
        </div>
        <div class="cleared"></div>
    </div>

    <!-- End product section-->


</div>